import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

export default {
  plugins: {
    'postcss-px-to-viewport': {
      viewportWidth: 375,
      unitToConvert: 'px',
      unitPrecision: 6,
      propList: ['*'],
      viewportUnit: 'vw',
      fontViewportUnit: 'vw',
      selectorBlackList: [],
      minPixelValue: 1,
      mediaQuery: true,
      include: [resolve(__dirname, 'src/H5Wapp')], // // 动态匹配 src/H5Wapp 目录及其所有子目录
      exclude: [
        /node_modules/, // 排除 node_modules
        /src\/(?!H5Wapp)/ // 排除 src 目录下非 H5Wapp 目录的文件
      ]
    }
  }
}
